
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QDialog,QWidget,QApplication

from UI.ui_aboutdialog import Ui_AboutDialog
import Resources
import config

class AboutDialog(QDialog):
    def __init__(self, parent: QWidget = None ) -> None:
        super(AboutDialog,self).__init__(parent)

        self.ui=Ui_AboutDialog()
        self.ui.setupUi(self)

        self.__InitUI()

    def __InitUI(self):

        self.setWindowIcon(QIcon(":/Image/UsageTool.png"))
        ScreenSize= QApplication.primaryScreen().size()
        self.move(ScreenSize.width()/2-self.size().width()/2,ScreenSize.height()/2-self.size().height()/2)
        self.ui.label_Version.setText(config.Vsersion)
        self.ui.textBrowser_Log.setHtml(config.Log)